/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ASAExpr;

import exception.DivisionByZeroException;
import exception.VariableNonDeclareeException;

/**
 *
 * @author FM & KB
 */
public class ASAExprAffectationMoinsEgal extends ASAExprAffectation {

    public ASAExprAffectationMoinsEgal(ASAExprRecupIdent e1, ASAExpr e2) {
        super(e1, e2);
    }

    public int evalue() throws VariableNonDeclareeException, DivisionByZeroException  {
        
        ASAExprIdent var = null;
        try {
            var = variable.recupVariable();
        } catch (VariableNonDeclareeException vnde) {
            System.out.println(vnde.getMessage());
        }
        int res = variable.evalue() - valeur.evalue();
        var.setValeur(res);
        return res;
    }

    @Override
    public String getLabelExplorateur() {
        return "AFFECT_MOINS_EGAL";
    }
}
